package main;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFormattedTextField;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

import spells.Fireball;
import spells.Heal;
import spells.Ignite;
import spells.PainSpike;
import spells.Replenish;

import creatures.Wolf;
/*
 * Has a brief introduction to the game world
 */

public class IntroWindow extends JFrame implements ActionListener {
	
	JButton next;
	JButton quit;

	static ArrayList<Creature> enemies;
	static String tile;
	Object object;
	int i;
	Enemy enemy;
	JFrame parent;
	static IntroChooserPanel choice;
	
	public IntroWindow(JFrame p) {
		//Initialize
		enemies=new ArrayList<Creature>();
		parent = p;
		tile="tiles/blueskyartpaper.jpg"/*"grass.gif"*/;
		//End of Initialize
		
		Dimension d = new Dimension (824,646);
		setSize(d);
		setVisible(true);
		getContentPane().setLayout(new BoxLayout(getContentPane(),BoxLayout.PAGE_AXIS));
		//setBackground(Color.black);
		
		Font HeroesQuest = new Font("HeroesQuest", 1, 12);
		JLabel Tag = new JLabel();
	    Tag.setFont(HeroesQuest);
	    Tag.setText("You are a " + IntroChooserPanel.job.getName() + " living in a world of.");

		JLabel Tag1 = new JLabel("Welcome " + IntroChooserPanel.name + ", brave " + IntroChooserPanel.job + " to the land of Ugther.");
	    JLabel Tag2 = new JLabel("It is a continent far from your home in this underground world of Erin.");
	    JLabel Tag3 = new JLabel("Many have tried to conquer Ugther and its harsh wilderness.");
	    JLabel Tag4 = new JLabel("But none have survived.");
	    JLabel Tag5 = new JLabel("You are drawn by the rumours of mysteries in the interior of the continent.");
	    JLabel Tag6 = new JLabel("Your abilities have never failed you before and you have no reason to believe you will now.");
	    JLabel Tag7 = new JLabel("Land is in sight now.  It is time to fufill your destiny...");

		
	    add(Box.createRigidArea(new Dimension(130, 0)));
	    
	    add(Tag1);
	    add(Box.createVerticalGlue());
	    add(Tag2);
	    add(Box.createVerticalGlue());
	    add(Tag3);
	    add(Box.createVerticalGlue());
	    add(Tag4);
	    add(Box.createVerticalGlue());
	    add(Tag5);
	    add(Box.createVerticalGlue());
	    add(Tag6);
	    add(Box.createVerticalGlue());
	    add(Tag7);

	    next = new JButton("Next");
	    next.addActionListener(this);
	    
	    quit = new JButton("Quit");
	    quit.addActionListener(this);
	    
	    add(Box.createVerticalGlue());
	    
	    add(next);
	    add(quit);
	    
	}
	
	public void actionPerformed(ActionEvent e) {
		if (e.getSource() == next){
			BattleGridTest test=new BattleGridTest(IntroStart.you, new GameGrids(IntroStart.you), 1, parent);
			this.setVisible(false);
		}
		else if (e.getSource() == quit) {
			System.exit(0);
		}
	}
}